import React from "react";
import {Link} from "react-router";

/**
 * 加载图片或样式文件
 * */
import './sass/Panel.scss';


export default class Panel extends React.Component {
    constructor(props) {
        super(props);
        this.state = {
        }
    }

    render() {
        const { title, href, className } = this.props;
        return (
            <div className={"base-panel " + (className|| '')}>
                <div className="base-panel-head">
                    {
                        !!href ? (
                            <Link to={href}>
                                <span dangerouslySetInnerHTML={{__html:title}}></span>
                                <i className="icon-arrow"/>
                            </Link>
                        ) : (
                            <span dangerouslySetInnerHTML={{__html:title}}></span>
                        )
                    }
                </div>
                <div className="base-panel-body">
                    {
                        this.props.children
                    }
                </div>
            </div>
        )
    }
}